<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <input type="hidden" name="row[id]" value="{$row['id']}">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('行为分类')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline" data-toggle="cxselect" data-selects="school,category">
                <select class="form-control school" name="row[school_id]" data-url="common/schools">
                    <option value="{$row['school_id']}"></option>
                </select>
                <select class="form-control category" name="row[category_id]" data-url="classes/behavior/cxCategoryList" data-query-name="school_id">
                    <option value="{$row['category_id']}"></option>
                </select>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control" name="row[name]" type="text" placeholder="{:__('Name')}" value="{$row.name|htmlentities}" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[type]', $typeData, $row['type'], ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
        </div>
    </div>

    <div class="form-group">
        <label for="c-score" class="control-label col-xs-12 col-sm-2">{:__('分值')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-score" class="form-control" name="row[score]" type="text" placeholder="{:__('Name')}" value="{$row.score|htmlentities}" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('图片')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div>
                {volist name="imageData" id="value"}
                <div class="behavior_container behavior_container_{$value.id} {if $row['image_id'] == $value.id} selected {/if}" ><img class="behavior_image" data-id="{$value.id}" src="{$value.url}" alt="" ></div>
                {/volist}
            </div>
            <input type="hidden" name="row[image_id]" id="image_id" value="{$row['image_id']}" data-rule="required">
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
